<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>找回密码</title>
    <link rel="stylesheet" href="__CSS__/supplies/bootstrap.min.css">
    <link rel="stylesheet" href="__CSS__/supplies/common.css">
    <link rel="stylesheet" href="__CSS__/supplies/restPassword.css">
    <style>
        .select_a{
            text-decoration: none;
            border:1px solid #BDBDBD;
            display: block;
            width: 100%;
            height: 44px;
            text-align: center;
            color: white;
            out-line: none;
        }
        .select_a:hover{
            text-decoration: none;
            color: white;
            background-color: #BDBDBD;
        }
        .select_a:visited{
            text-decoration: none;
            color: white;
        }
        .select_a:active{
            text-decoration: none;
            color: white;
        }
        a:focus{
            text-decoration: none;
            color:#000;
        }
        .placeholder{
            width: 260px;
        }
    </style>
</head>
<body>
<div class="reg_container">
    <div class="reg_content form-inline">
        <div class="reg_left_from form-group">
            <div class="form_title" style="font-size: 24px;line-height: 24px;color: #FF690D;">
                找回密码</br><span class="font_size_16">Retrieve the password</span>
            </div>
            <div class="form_content">
                <div class="user_name input_div">
                    <div class="placeholder">手机号<br/>Phone number</div>
                    <input type="text" class="tel input_placeholder" isvalid="yes" checkexpession="NotNull" errormsg="手机号不能为空<br/>Cell phone number can not be empty"/>
                </div>
                <div class="code form-inline input_div">
                    <div class="placeholder" style="width: 160px;">验证码<br/>Verificotion code</div>
                    <input type="text" class="form-group smscode input_placeholder" style="width: 160px;" isvalid="yes" checkexpession="NotNull" errormsg="验证码<br/>The verifying code cannot be empty"/>
                    <!--<button class="form-group get_code">获取验证码</br>get the verify</button>-->
                    <a class="form-group select_a get_code font_size_14" style="margin-top:-1px;text-align:center;width: 96px;height:44px;border: 1px solid #FF6A10;color: #FF690D;">获取验证码</br><span class="font_size_11">get the verify</span></a>
                </div>
                <div class="user_name input_div">
                    <div class="placeholder">新密码<br/>New password</div>
                    <input type="text" isvalid="yes" class="password input_placeholder" checkexpession="NotNull" errormsg="验证码<br/>New password can not be empty"/>
                </div>
            </div>
            <div class="commint_btn">
                <a class="select_a btn_color_right font_size_14" style="cursor:pointer;line-height: 13px;padding-top: 8px;">重置密码</br><span class="font_size_11">rest password</span></a>
                <!--<button>重置密码</br>rest password</button>-->
            </div>
        </div>
    </div>
</div>
</body>
<script rel="script" src="__JS__/supplies/jquery.min.js"></script>
<script rel="script" src="/js/supplies/validator/validator.js"></script>
<script rel="script" src="/js/supplies/common_input.js"></script>
<script>
    //获取验证码
    $('.get_code').click(function(){
        $tel =  $('.tel').val();
        $.ajax({
            type: "get",
            url: "__APP__/apishop/index/getMsgCode",
            cache: false,
            data: {tel: $tel},
            dataType: "json",
            success: function (data) {
                // console.log(data);
            }
        });
    })
    //提交
    $('.commint_btn').click(function(){
        $tel =  $('.tel').val();
        $password =  $('.password').val();
        $code =  $('.smscode').val();

        if('' == $tel){
            confirm('注册号码不能为空');
        }
        else if('' == $password){
            confirm('密码不能为空');
        }
        else if('' == $code){
            confirm('验证码不能为空');
        }else{
            $.ajax({
                type: "get",
                url: "__APP__/apishop/apishop/findPassword",
                cache: false,
                data: {tel: $tel, pwd: $password, code: $code},
                dataType: "json",
                success: function (data) {
                    console.log(data);
                    if (200 == data['status']) {
                        location.href = "__APP__/supplies/index/index";
                    }else{
                        confirm(data['msg']);
                    }
                }
            });
        }
    })
</script>
</html>